About Query

A query is used to extract data from the database in a readable format according to the user's request. Navicat provides powerful tools for working with queries: Query Editor for editing the query text directly, and Query Builder, Find Builder or Aggregate Builder for building queries visually. You can save your queries for setting automation tasks. In the main window, click Query Query to open the query object list. You can also click New Query New Query from the main toolbar to create a new query without opening any connections.

To open a query using an external editor, control-click it and select Open with External Editor. You can set the file path of an external editor in Preferences.

Hint: Queries (.sql or .js) are stored under the Settings Location. To open the folder, control-click a query and select Show in Finder. If the connection is synchronized to Navicat Cloud, its queries are stored in the Cloud.

Query Designer

Query Designer is the basic Navicat tool for working with queries.

Button

Description

MySQL, Oracle, PostgreSQL, SQLite, SQL Server and MariaDB

SQL Builder

Open the SQL Builder for building queries visually.

Beautify SQL

Format the codes with the Beautify SQL settings in Editor.

MongoDB

Find Builder

Open the Find Builder for building queries visually.

Aggregate Builder

Open the Aggregate Builder for building queries visually.

Beautify Script

Format the codes in Editor.

Type Color

[Grid View] Use the specified type color set on the Type Color pane to highlight cells.

Common

Code Snippet

Show the Code Snippet pane.

Text

Activate the assistant editors for viewing and editing data.

Export Result

Export the result of the query.

Run

Execute the query: Run, Run Current Statement, or Run Selected (when highlighted code).
MongoDB does not support Run Current Statement.

Stop

Stop the executing query.

Explain

Show the Query Plan of the query: Explain or Explain Selected (when highlighted code).

Open an external file in Navicat

Save an opened external file as a Navicat query

Save a Navicat query as an external file